<!--公共考试成绩查询-->
<template>
  <div class="wrapper-container">
    <div class="table-container table-css">
      <el-table :data="tableData" border style="width: 100%" class="table-data" :header-cell-style="{background:'#edf2f9','border-color': '#c7d7eb'}"  >
        <el-table-column prop="order" label="序号" align="center" width="80"></el-table-column>
        <el-table-column prop="examDate" label="考试日期" align="center"  width="180"></el-table-column>
        <el-table-column prop="examBatchName" label="考试名称" align="center"> </el-table-column>
        <el-table-column prop="studentName" label="成绩信息" align="center">
            <template slot-scope="scope">
                <span class="editName"> {{scope.row.examScore}}</span>
            </template>
        </el-table-column>
        <el-table-column prop="countryInfo" label="全国成绩情况" align="center"></el-table-column>
        <el-table-column prop="company" label="校区成绩情况" align="center">
          <template slot-scope="scope">{{scope.row.examStatisticsVO}}</template>
        </el-table-column>
      </el-table>
    </div>
    <div class="export-button" @click="importExcel">
        <img src="../../assets/assessment/icon-export.png" alt="" />
        <span>导出Excel</span>
    </div>
  </div>
</template>

<script>
import {studentList} from "@/api/exam";
import fileDownload from "js-file-download"
import Axios from 'axios'
export default {
  data() {
    return {
      tableData: [],
    };
  },
  mounted(){
    this.getList()
  },
  methods: {
    //初始化表格
    async getList(){
      let res = await studentList();
      if(res.code == 200){
        this.tableData = res.data.records;
      }else{
        this.$message.error(res.msg);
      }
    },
    //导出
    importExcel(){
      Axios({
          method: 'get',
          url: this.$store.state.studentUrl.baseUrl+'/examScore/exportStudentScore',
          params:this.dataForm,
          headers: {'Content-Type': 'application/octet-stream' },
              responseType: 'blob'
      }).then(res => {
          fileDownload(res.data, '公共考试成绩.xlsx');
      }); 
    },
  },
};
</script>
<style lang="less" scoped>
.table-css {
  margin-top: 30px;
  /deep/.el-table td,
  .el-table th.is-leaf,
  .el-table--border,
  .el-table--group {
    border-color: #c7d7eb;
  }

 /deep/ .el-table__header tr,
  .el-table__header th {
    padding: 0;
    height: 76px;
    background-color: #edf2f9;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 20px;
    color: #004ca7;
  }

  /deep/.el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 86px;
  }

}
</style>

<style lang="less" scoped>
@import "../../styles/commonCss.less";
.color-warning{
    background: #FEF1E8;
    border: 1px solid #F86900;
    >span{color:#F86900;}
    >img{width: 17px!important;height:17px!important}
}
</style>
